#ifndef FlashBang_H
#define FlashBang_H

#include "Engine.h"
#include "InputSet.h"
#include "MotionState.h"
#include <OgreEntity.h>
#include "PlayingFieldConstants.h"
#include "ScoreCard.h"
#include "RiotShield.h"
#include <SDL/SDL_mixer.h>
#include <stdlib.h>

#define SCORE 5

//a class that represents a flash bang in the scene
class FlashBang{
public:
	FlashBang(char* name, Ogre::SceneManager* sm, Ogre::SceneNode* toAddTo, ScoreCard* scoreboard, RiotShield* playerS);
	void updateState();
	void alertToInput( const InputSet& input );
protected:
	MotionState myPos;
	Ogre::SceneNode* myNode;
	ScoreCard* theScore;
	RiotShield* playerShield;
	bool selfPhysics;
	bool gameOver;
	Mix_Chunk* shieldBounce;
	Mix_Chunk* wallBounce;
	Mix_Chunk* myEyesAHHH;
	Mix_Chunk* explosion;
	Mix_Chunk* pulledPin;
	Mix_Chunk* youFailed;
	Mix_Chunk* youreFired;
	int timeToWait;
	int grenadesLeft;
	int laughDelay;
	int chastiseDelay;
	bool soundLive;
	bool lock;
	
	void randomizeVelocity(double* xv, double* yv);
	void playWallContact();
	void playShieldContact();
	void makeScore();
	void playOhGodMyEyes();
	void shieldMissed();
	void playScoreSound();
	void playPinPull();
	void playGameOver();
	void playWardenAngry();
	bool checkShieldForHit(RiotShield* shield);
};

#endif
